var o = null;

Page({
    data: {
        userInfo: {},
        hasUserInfo: !1,
        canIUseGetUserProfile: !0,
        canIUseOpenData: wx.canIUse("open-data.type.userAvatarUrl") && wx.canIUse("open-data.type.userNickName"),
        showZan: !1
    },
    onLoad: function(o) {
        this.initAd();
    },
    initAd: function() {
        console.log("init插屏"), wx.createInterstitialAd && ((o = wx.createInterstitialAd({
            adUnitId: "adunit-3bbda372e336d672"
        })).onLoad(function() {
            console.log("加载插屏ok");
        }), o.onError(function(o) {}), o.onClose(function() {}));
    },
    showAd: function() {
        var n = this;
        o && 1 != this.AD_SHOWED ? o.show().then(function() {
            console.log("显示ad完成"), n.AD_SHOWED = !0;
        }).catch(function(o) {
            console.error(o);
        }) : (console.log("不显示广告"), console.log(this.AD_SHOWED));
    },
    onReady: function() {},
    onShow: function() {
        this.showAd();
    },
    toHistory: function() {
        console.log("to history"), wx.navigateTo({
            url: "/pages/history/history"
        });
    },
    toAdSetting: function() {
        console.log("to adsetting"), wx.navigateTo({
            url: "/pages/adsetting/adsetting"
        });
    },
    getUserProfile: function(o) {
        var n = this;
        wx.getUserProfile({
            desc: "展示用户信息",
            success: function(o) {
                console.log(o), n.setData({
                    userInfo: o.userInfo,
                    hasUserInfo: !0
                });
            }
        });
    },
    showPayImage: function(o) {
        console.log("showpay");
        wx.previewImage({
            urls: [ "http://img.gaomingyang.cn/recognition/zan.jpg" ]
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});